package com.qidianit.mes.pro.controller;

import com.github.pagehelper.PageInfo;
import com.qidianit.mes.pojo.Result;
import com.qidianit.mes.pojo.pro.ProductionOrder;
import com.qidianit.mes.pojo.pro.ProductionReport;
import com.qidianit.mes.pojo.pro.Workflow;
import com.qidianit.mes.pro.service.ProductionOrderService;
import com.qidianit.mes.pro.service.ProductionReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;

/**
 * @Description:
 * @Author: wang fei long
 * @Date: 2025/9/17 0017 - 16:16
 */
@RestController
@RequestMapping("/productionReport")
@CrossOrigin
public class ProductionReportController {
    @Autowired
    private ProductionReportService productionReportService;
    @GetMapping("/page")
    public Result<PageInfo<ProductionReport>> selectProductionReport(ProductionReport productionReport, @RequestParam(defaultValue = "1")int pageNum, @RequestParam(defaultValue = "10")int pageSize){
        return productionReportService.selectProductionReport(productionReport,pageNum,pageSize);
    }
    @PutMapping("/update")
    public Result updateProductionReport(@RequestBody ProductionReport productionReport) {
        return productionReportService.updateProductionReport(productionReport);
    }
    @PutMapping("/update1/{id}")
    public Result updateStatus1(@PathVariable Long id) {
        return productionReportService.updateStatus1(id);
    }
    @PutMapping("/update2/{id}")
    public Result updateStatus2(@PathVariable Long id) {
        return productionReportService.updateStatus2(id);
    }
    @PutMapping("/update3/{id}")
    public Result updateStatus3(@PathVariable Long id) {
        return productionReportService.updateStatus3(id);
    }
    @GetMapping("/id/{id}")
    public Result<ProductionReport> selectById(@PathVariable Long id) {
        return productionReportService.selectById(id);
    }
    @DeleteMapping("/delete/{id}")
    public Result deleteById(@PathVariable Long id) {
        return productionReportService.deleteById(id);
    }
    @DeleteMapping("/batchDelete")
    public Result batchDelete(Long[] id) {
        return productionReportService.batchDelete(id);
    }


}
